/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

/*
 * @Author: qiulin 1746365080@qq.com
 * @Date: 2024-11-05 14:23:38
 * @LastEditors: qiulin_JXGM ql1746365080@gmail.com
 * @LastEditTime: 2024-12-06 20:44:52
 * @FilePath: /SGSim/DBManager/Service/Input/Constraint/TEMPService.h
 */

#pragma once
#include "DBManager/Common/ServiceMacro.h"
#include "DBManager/IRepository/Input/Constraint/ITEMPRepository.h"
#include "DBManager/IService/Input/Constraint/ITEMPService.h"

SG_DBMANAGER_NAMESPACE_OPEN
using IRepos = ITEMPRepository;
class DBManager_DECLSPEC TEMPService : ITEMPService
{
  public:
    TEMPService (ITEMPRepository& repos);
    ~TEMPService () = default;

    FUNCTION_Add (ITEMPService::ServiceDataType);

    // 返回单点约束的数量
    std::size_t Size () override;

    // 根据索引查找单点约束
    SG::DataStructure::Common::Status FindByIndex (std::size_t index, SG::DataStructure::FEM::TEMPData& _OUT entity) override;

    /** @brief 查询sid约束集编号对应的所有TEMP */
    SG::DataStructure::Common::Status FindBySId (SG::DataStructure::Common::Id                       sId,
                                                 std::vector<SG::DataStructure::FEM::TEMPData>& _OUT mpcSet) override;

  private:
    ITEMPRepository& m_repository;  ///< 数据仓库
};

SG_DBMANAGER_NAMESPACE_CLOSE
